<?php
/**
 * Create By: PhpStorm
 * User: niechenguang
 * File: Circle.php
 * Date: 2017/1/2
 * Time: 21:45
 */

namespace app\api\controller;

use app\api\model\page\chat\AddBlack;
use app\api\model\page\chat\AddFriend;
use app\api\model\page\chat\BlackList;
use app\api\model\page\chat\CheckPhoneBook;
use app\api\model\page\chat\DelBlack;
use app\api\model\page\chat\DelFriend;
use app\api\model\page\chat\GetFriends;
use app\api\model\page\chat\SearchFriend;
use think\Request;

class Chat
{

    protected $param;

    public function __construct()
    {
        $this->param = Request::instance()->param();
    }

    /**
     * 加好友
     *
     * @return array
     */
    public function addFriend()
    {
        $obj = new AddFriend();
        return $obj->excute($this->param);
    }

    /**
     * 删除好友
     *
     * @return array
     */
    public function delFriend()
    {
        $obj = new DelFriend();
        return $obj->excute($this->param);
    }

    /**
     * 获取好友列表
     *
     * @return array
     */
    public function getFriends()
    {
        $obj = new GetFriends();
        return $obj->excute($this->param);
    }

    /**
     * 查找好友
     *
     * @return array
     */
    public function searchFriend()
    {
        $obj = new SearchFriend();
        return $obj->excute($this->param);
    }

    /**
     * 拉黑
     *
     * @return array
     */
    public function addBlack()
    {
        $obj = new AddBlack();
        return $obj->excute($this->param);
    }

    /**
     * 取消拉黑
     *
     * @return array
     */
    public function delBlack()
    {
        $obj = new DelBlack();
        return $obj->excute($this->param);
    }

    /**
     * 获取拉黑列表
     *
     * @return array
     */
    public function blackList()
    {
        $obj = new BlackList();
        return $obj->excute($this->param);
    }

    /**
     * 校验通讯录是否是环信用户
     *
     * @return array
     */
    public function checkPhoneBook()
    {
        $obj = new CheckPhoneBook();
        return $obj->excute($this->param);
    }
}
